package com.sxz.sbs.module.client.presenter;

import com.sxz.sbs.app.App;
import com.sxz.sbs.module.client.bean.EvidenceDetailBean;
import com.sxz.sbs.module.client.view.EvidenceDetailView;
import com.sxz.sbs.rx.RxPresenter;
import com.sxz.sbs.rx.RxSubscriber;
import com.sxz.sbs.rx.RxUtil;

import java.util.HashMap;

/**
 * Created by tian on 2018/1/25 0025.
 */

public class EvidenceDetailPresenter extends RxPresenter<EvidenceDetailView>{
    /**
     *
     * @param map
     */
    public void getEvidenceDetail (final HashMap<String,Object> map) {
        addSubscribe(App.getInstance().getApi().getEvidenceDetail(map)
                .compose(RxUtil.<EvidenceDetailBean>handleResult())
                .subscribeWith(new RxSubscriber<EvidenceDetailBean>(mView,true){
                    @Override
                    public void onNext(EvidenceDetailBean data) {
                        mView.onGetEvidenceDetailSuccess(data);
                    }
                })
        );
    }
}
